import request from '@/utils/request'

// export function getEmpPage(params) {
//   return request({
//     url: '/admin/employee/page',
//     method: 'get',
//     params
//   })
// }
//


const CATEGORY_API_PREFIX = '/admin/category'
export default {
  getCategoryCascader() {
    return request({
      url: CATEGORY_API_PREFIX + '/cascader',
      method: 'get'
    })
  },
  getCategoryPage(current, pageSize, params) {
    return request({
      url: CATEGORY_API_PREFIX + '/' + current + '/' + pageSize,
      method: 'get',
      params
    })
  },
  deleteBatchCategory(ids) {
    return request({
      url: CATEGORY_API_PREFIX + '/batch',
      method: 'delete',
      data: ids
    })
  },
  deleteCategory(id) {
    return request({
      url: CATEGORY_API_PREFIX + '/' + id,
      method: 'delete'
    })
  },
  updateById(id, data) {
    return request({
      url: CATEGORY_API_PREFIX + '/' + id,
      method: 'put',
      data
    })
  },
  getById(id) {
    return request({
      url: CATEGORY_API_PREFIX + '/' + id,
      method: 'get'
    })
  },
  saveCategory(data) {
    return request({
      url: CATEGORY_API_PREFIX + '/parent',
      method: 'post',
      data
    })
  },
  getTopCategory() {
    return request({
      url: CATEGORY_API_PREFIX + '/top',
      method: 'get'
    })
  },
}
